<div class="bjui-pageHeader">
    <div class="pull-right">
        <button type="button" class="btn-default send_email" data-icon="envelope" title="发邮件" data-toggle="tooltip" data-placement="bottom"></button>
        <button type="button" class="btn-default send_msg" data-icon="envelope-o" title="发站内信" data-toggle="tooltip" data-placement="bottom"></button>
        <button class="btn-default" data-icon="plus" title="添加会员" data-toggle="tooltip" data-placement="bottom" onclick="createDialog('{:U("Forms/addmember")}', '增加会员', 'add_membar',{width:700})" ></button>
        <a href="{:U('index/save')}" class="btn btn-default" data-toggle="doajaxchecked" data-icon="remove" data-callback="callbackRefres" data-confirm-msg="要删除全部选中的吗??" data-idname="id" data-group="ids"></a>
        <button class="btn-default" data-icon="refresh" onclick="$.CurrentNavtab.navtab('refresh')"></button>
    </div>
    <form id="pagerForm" data-toggle="ajaxsearch" data-loadingmask="true" action="{:U('index')}" method="post">
        <input type="hidden" name="pageSize" value="{:I('param.pageSize')}" />
        <input type="hidden" name="pageCurrent" value="{:I('param.pageCurrent')}" />
        <input type="hidden" name="orderField" value="{:I('param.orderField')}" />
        <input type="hidden" name="orderDirection" value="{:I('param.orderDirection')}" />
        <div class="bjui-searchBar">
            <label>状态:</label>
            <select name="status" data-toggle="selectpicker">
                <option value="">全部</option>
                <option value="0" <if condition="I('status') eq '0'">selected</if>>正常</option>
                <option value="1" <if condition="I('status') eq '1'">selected</if>>已关闭</option>
            </select>
            <label>会员等级:</label>
            <select name="group_id" data-toggle="selectpicker">
                <option value="">--请选择--</option>
                <volist name="res" id="va">
                <option value="{$va.id}" <if condition="I('group_id') eq $va['id']">selected</if>>{$va.name}</option>
                </volist>
            </select>
            <label>关键字:</label>
            <input type="text" name="name" value="{:I('name')}"placeholder="昵称,手机,邮箱" />
            <button type="submit" class="btn-default" data-icon="search">查询</button>
            <a class="btn btn-orange" href="javascript:;" data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">清空查询 </a>
        </div>
    </form>
</div>
<div class="bjui-pageContent tableContent">
    <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="false">
        <thead>
        <tr>
            <th width="26"><input type="checkbox" class="checkboxCtrl" data-group="ids" data-toggle="icheck"></th>
            <th>昵称</th>
            <th>等级</th>
            <th>累计消费</th>
            <th>邮件地址</th>
           <!--  <th>一级下线数</th> -->
            <th>手机号码</th>
           <!--  <th>余额</th> -->
            <th>积分</th>
            <th>注册日期</th>
            <th width="140">操作</th>
        </tr>
        </thead>
        <tbody>
        <volist name="list" id="vo">
        <tr>
            <td width="26"><input type="checkbox" value="{$vo.id}" class="checkboxCtrl" name="ids" data-toggle="icheck"></td>
            <td>{$vo.name}</td>
            <td>{$vo.groupname|default="无"}</td>
            <td>{$vo.exp_money}</td>
            <td><a href="javascript:void(0)" onclick="createDialog('{:U("Forms/email", array('id'=>1))}','发邮件', 'send_email',{width:800, height:500})">{$vo.email}</a></td>
           <!--  <td>0</td> -->
            <td>{$vo.mobile}</td>
           <!--  <td>{$vo.balance}</td> -->
            <td>{$vo.point}</td>
            <td>{$vo.add_time}</td>
            <td>
                <button type="button" class="btn-green" onclick="createDialog('{:U("Forms/member",array("id"=>$vo["id"]))}', '会员资料', 'member_msg', {width:800, height:500})">改</button>
                <button type="button" class="btn-blue" onclick="createDialog('{:U("Common/member_log",array("id"=>$vo["id"]))}', '用户资金记录', 'member_log',{width:800, height:500})">录</button>
                <a href="{:U('Forms/del_user',array('id'=>$vo['id']))}" data-type="get" class="btn btn-red" data-toggle="doajax" data-confirm-msg="你确定要删除吗？删除之后就不能恢复啦" >删</a>
            </td>
        </tr>
        </volist>
        <!-- <tr>
            <td width="26"><input type="checkbox" value="2" class="checkboxCtrl" name="ids" data-toggle="icheck"></td>
            <td>老李</td>
            <td>注册会员</td>
            <td>1234</td>
            <td><a href="javascript:void(0)" onclick="createDialog('{:U("Forms/email", array('uid'=>2))}','发邮件', 'send_email',{width:800, height:500})">34754319@qq.com</a></td>
            <td>0</td>
            <td>13699772411</td>
            <td>12.00</td>
            <td>100</td>
            <td>2015-12-12 12:12:12</td>
            <td>
                <button type="button" class="btn-green" onclick="createDialog('{:U("Forms/member")}', '会员资料', 'member_msg', {width:800, height:500})">改</button>
                <button type="button" class="btn-blue" onclick="createDialog('{:U("Common/member_log")}', '用户资金记录', 'member_log',{width:800, height:500})">录</button>
                <a href="{:U('Index/save')}" class="btn btn-red" data-toggle="doajax" data-confirm-msg="" >删</a>
            </td>
        </tr> -->
        </tbody>
    </table>
</div>
<script>
    $(function () {
        function checkout() {
            var ids = [];
            $.CurrentNavtab.find('input[name=ids]').each(function (index, item) {
                if(item.checked){
                    ids.push(item.value);
                }
            });
            return ids;
        }
       $('.send_email').click(function () {
            var ids = checkout();
           if( ids.length < 1 ){
               $(this).alertmsg('error', '请至少选择一位会员');
               return ;
           }
           createDialog('{:U("Forms/email")}?uid='+ids.join(','), '发邮件', 'send_email', {width:800, height:500} ) ;
       });
        $('.send_msg').click(function () {
            var ids = checkout();
            if( ids.length < 1 ){
                $(this).alertmsg('error', '请至少选择一位会员');
                return ;
            }
            createDialog("{:U('Forms/msg')}?uid=" + ids.join(','), '发站内信', 'send_msg', {width:800, height:500});
        });
    });
</script>
<include file="Common/footer" ftype="page" />